#include "Automatas.h"
#include <tr1/memory>
#include <vector>
#include <string>
#include <map>


class NFAtoDFAConversion
{
public:
    NFAtoDFAConversion(std::tr1::shared_ptr<NondeterministicFiniteAutomaton> nfa);
    
    std::tr1::shared_ptr<DeterministicFiniteAutomaton> getDfa();
    
private:
    void initDfa();
    void setFinalStates();
    
    bool isFinal(const string& stateStr);

    
    std::tr1::shared_ptr<NondeterministicFiniteAutomaton> _nfa;
    std::tr1::shared_ptr<DeterministicFiniteAutomaton> dfa;
    
    map<std::string, int> states;
    vector<pair<string, unsigned> > newStates;
};
